{	Problem: http://codeforces.ru/problemset/problem/63/B
	Verdict: Accepted

}
var i,n,res,k,t:longint; s,nm,st:string; a,b:array[0..110] of longint; f:boolean;
function check:longint;
var i:longint;
begin
i:=n+1;
result:=0;
while (i>0) and (result=0) do begin
  dec(i);
  if a[i]<k then result:=i;
end;
end;
procedure qsort(l,r:longint);
var i,j,x,y:longint;
begin
i:=l;
j:=r;
x:=a[(l+r) div 2];
repeat
  while a[i]<x do inc(i);
  while a[j]>x do dec(j);
  if i<=j then begin
    y:=a[i];
    a[i]:=a[j];
    a[j]:=y;
    inc(i);
    dec(j);
  end;
until i>j;
if l<j then qsort(l,j);
if i<r then qsort(i,r);
end;
begin
readln(n,k);
for i:=1 to n do read(a[i]);
res:=0;
qsort(1,n);
for i:=1 to n do b[i]:=a[i];
t:=check;
while t<>0 do begin
  inc(res);
for i:=t downto 1 do begin
  if (b[i]<>b[i+1]) or (i=t) then f:=false;
  if (a[i]<k) and (f=false) then begin
    inc(a[i]);
    f:=true;
  end;
end;
  qsort(1,t);
  for i:=1 to t do b[i]:=a[i];
  t:=check;
end;
writeln(res);
end.